package com.mysoft.gfyx.marketdevelop.controller;

import com.mysoft.framework.modeling.dto.ListDataResult;
import com.mysoft.framework.modeling.dto.LoadDataParams;
import com.mysoft.framework.rpc.annotation.PubAction;
import com.mysoft.framework.rpc.annotation.PubService;
import com.mysoft.framework.rpc.contants.RequestPrefix;
import com.mysoft.gfyx.marketdevelop.controller.dto.GetDetailDataRequestDto;
import com.mysoft.gfyx.marketdevelop.service.DeveloperCommencePermitService;
import com.mysoft.gfyx.marketdevelop.service.SearchService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

@PubService(value = "/searchCommencePermitPub", prefix = RequestPrefix.PUB)
@Tag(name = "找开工-PUB")
public class SearchCommencePermitPubController {
    @Resource
    private SearchService searchService;

    @Resource
    private DeveloperCommencePermitService developerCommencePermitService;


    // 在建项目搜索
    @PubAction(value = "/searchCommencePermit", method = RequestMethod.POST)
    public ListDataResult searchCommencePermit(@RequestBody LoadDataParams options) {
        return searchService.loadSearchCommencePermitData(options);
    }

    // 在建项目详情
    @PubAction(value = "/detail", method = RequestMethod.POST)
    public Object commencePermitDetail(@RequestBody GetDetailDataRequestDto dto) {
        return developerCommencePermitService.getCommencePermitDetail(dto);
    }
}